-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes edge case where soft-cliped portion of a read ends up at a nega… #1513
Conversation
Made this initial PR, waiting on tests to pass and a larger test on a full sized bam to complete. |
@yfarjoun We found an annoying edge case. Assuming this passes tests, could you take a look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we talked offline about making this better with a different one-line change...
@@ -819,10 +819,10 @@ private static int getReadPositionAtReferencePositionIgnoreSoftClips(final SAMRe | |||
|
|||
// Temporarily use the newCigar that has SOFT_CLIPs replaced with MATCH_OR_MISMATCH to get read position at reference, but ignore existence of soft-clips | |||
rec.setCigar(newCigar); | |||
readPosition = SAMRecord.getReadPositionAtReferencePosition(rec, pos, false); | |||
readPosition = SAMRecord.getReadPositionAtReferencePosition(rec, pos + posShift, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment that since the read effectively got shifted forward by turning the clips into matches, the query position needs also to be moved forward so that it's still querying the same base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch.
thanks for the tests.
thumbs up after adding a comment.
…tive position
Description
Give your PR a concise yet descriptive title
Please explain the changes you made here.
Explain the motivation for making this change. What existing problem does the pull request solve?
Mention any issues fixed, addressed or otherwise related to this pull request, including issue numbers or hard links for issues in other repos.
You can delete these instructions once you have written your PR description.
Checklist (never delete this)
Never delete this, it is our record that procedure was followed. If you find that for whatever reason one of the checklist points doesn't apply to your PR, you can leave it unchecked but please add an explanation below.
Content
Review
For more detailed guidelines, see https://github.com/broadinstitute/picard/wiki/Guidelines-for-pull-requests